import axios from '@/libs/api.request'

/**
 * 获取表格数据
 * @return {[type]}        [description]
 */
export const fetchTableData = params => {
  return axios.request({
    url: '/api/gasMonitoring/getZeroGasMeterPaged',
    method: 'get',
    params
  })
}

/**
 * 获取矩形方图数据
 * @return {[type]}        [description]
 */
export const fetchTreeMap = (params) => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterGasCalssCountByYear',
    method: 'get',
    params
  })
}

/**
 * desc: 获取k线图数据
 * param {type}
 * return: void
 */
export const fetchCenterTopCandData = params => {
  return axios.request({
    url: '/api/gasMonitoring/getMeterKLine',
    method: 'get',
    params
  })
}

/**
 * 表具详情
 * @return {[type]}        [description]
 */
export const fetchMeterDetail = id => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterBeanByMeterId/' + id,
    method: 'get'
  })
}

export const fetchAbnormalData = (params) => {
  return axios.request({
    url: '/api/localDataMonth/getMeterDetailByDay',
    method: 'get',
    params
  })
}

export const fetchGetParams = (params) => {
  return axios.request({
    url: '/api/gasMonitoring/getZeroParam',
    method: 'get',
    params
  })
}

/**
 * 设置参数
 * @return {[type]}        [description]
 */
export const fetchSetParams = (data) => {
  return axios.request({
    url: '/api/gasMonitoring/updateZeroParam',
    method: 'post',
    data
  })
}

/**
 * 信任
 * @return {[type]}        [description]
 */
export const fetchXr = (data) => {
  return axios.request({
    url: '/api/gasMonitoring/updateZeroTrust',
    method: 'post',
    data
  })
}
